# -*- coding: utf-8 -*-

def index():

    functions = { 'post': post }

    return functions[ request.env.request_method.lower() ]( request.get_vars )


def post( postVars ):

    return response.json( dict( id = db.tournament.insert( **postVars ) ) )

